package com.stephentuso.welcome;

import com.stephentuso.welcome.util.ResUtil;
import ohos.app.Context;
import ohos.global.resource.NotExistException;
import ohos.global.resource.WrongTypeException;

import java.io.IOException;

/**
 * Created by stephentuso on 11/16/15.
 */
/* package */ class ColorHelper {

    /* package */ static int getColor(Context context, int resId) {
        return ResUtil.getColor(context, resId);
    }

    /* package */ static int resolveColorAttribute(Context context, String resIdName, int fallback) {
        try {
            return context.getTheme().getColorValue(resIdName);
        } catch (Exception e) {
            return fallback;
        }
    }

}
